package com.zz.mvc.unit;

import java.lang.reflect.Field;

import javax.activation.FileDataSource;
import javax.servlet.http.HttpServletRequest;

import com.sun.jndi.url.dns.dnsURLContext;
import com.zz.mvc.form.ActionForm;


public class FullBean {
	
   public FullBean(){
	   
   }
   public  static ActionForm full(HttpServletRequest request) {
	   ActionForm o=null;
	    try {
			Class class1=Class.forName(request.getParameter("zz"));
			o=(ActionForm)class1.newInstance();
			Field[] field_ar=class1.getDeclaredFields();
			for(Field f:field_ar){
				f.setAccessible(true);
				f.set(o, request.getParameter(f.getName()));
				//System.out.print(request.getParameter(f.getName()));
				f.setAccessible(false);
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	   return o;
}
}
